Skip to content

chore(clerk-js): Use local environment on outage - #5420

Merged
panteliselef merged 8 commits into
mainfrom
elef/sdki-955-persist-environment-locally
Mar 26, 2025
Merged

chore(clerk-js): Use local environment on outage#5420
panteliselef merged 8 commits into
mainfrom
elef/sdki-955-persist-environment-locally

Conversation

@panteliselef

Copy link
Copy Markdown
Contributor

Description

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Mar 21, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 26, 2025 9:08pm

@changeset-bot

changeset-bot Bot commented Mar 21, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9bad073

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@panteliselef panteliselef self-assigned this Mar 21, 2025
Comment thread packages/clerk-js/src/utils/localStorage.ts Outdated
Comment on lines +2092 to +2102
.catch(e => {
const environmentSnapshot = SafeLocalStorage.getItem<EnvironmentJSONSnapshot | null>(
CLERK_ENVIRONMENT_STORAGE_ENTRY,
null,
);

if (!environmentSnapshot) {
throw e;
}

this.updateEnvironment(new Environment(environmentSnapshot));

@jacekradko jacekradko Mar 25, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if this logic shouldn't be contained within the EnvironmentResource class. Seems like it could simplify the implementation overall

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused here, are you advocating for this to be included in the Environment class because currently it is not.

If that is the case, I'd suggest doing this in another follow up PR, which will improve the overall architecture which would handle this for non-standard browsers (e.g. Expo).

@jacekradko jacekradko Mar 26, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@panteliselef Yes, I think having this logic be encapsulated in the EnvrionmentResource class would be preferrable. No issue with doing it as a follow up

…-locally

# Conflicts:
#	packages/clerk-js/bundlewatch.config.json
@panteliselef

Copy link
Copy Markdown
Contributor Author

!snapshot

@clerk-cookie

Copy link
Copy Markdown
Collaborator

Hey @panteliselef - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.0.16-snapshot.v20250326201838
@clerk/astro 2.4.5-snapshot.v20250326201838
@clerk/backend 1.25.8-snapshot.v20250326201838
@clerk/chrome-extension 2.2.23-snapshot.v20250326201838
@clerk/clerk-js 5.58.1-snapshot.v20250326201838
@clerk/elements 0.23.8-snapshot.v20250326201838
@clerk/clerk-expo 2.9.6-snapshot.v20250326201838
@clerk/expo-passkeys 0.1.29-snapshot.v20250326201838
@clerk/express 1.3.59-snapshot.v20250326201838
@clerk/fastify 2.1.32-snapshot.v20250326201838
@clerk/localizations 3.13.4-snapshot.v20250326201838
@clerk/nextjs 6.12.12-snapshot.v20250326201838
@clerk/nuxt 1.4.6-snapshot.v20250326201838
@clerk/clerk-react 5.25.5-snapshot.v20250326201838
@clerk/react-router 1.1.11-snapshot.v20250326201838
@clerk/remix 4.5.11-snapshot.v20250326201838
@clerk/shared 3.2.3-snapshot.v20250326201838
@clerk/tanstack-react-start 0.12.2-snapshot.v20250326201838
@clerk/testing 1.4.33-snapshot.v20250326201838
@clerk/themes 2.2.26-snapshot.v20250326201838
@clerk/types 4.50.1-snapshot.v20250326201838
@clerk/vue 1.4.5-snapshot.v20250326201838

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.0.16-snapshot.v20250326201838 --save-exact

@clerk/astro

npm i @clerk/astro@2.4.5-snapshot.v20250326201838 --save-exact

@clerk/backend

npm i @clerk/backend@1.25.8-snapshot.v20250326201838 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.2.23-snapshot.v20250326201838 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.58.1-snapshot.v20250326201838 --save-exact

@clerk/elements

npm i @clerk/elements@0.23.8-snapshot.v20250326201838 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.9.6-snapshot.v20250326201838 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@0.1.29-snapshot.v20250326201838 --save-exact

@clerk/express

npm i @clerk/express@1.3.59-snapshot.v20250326201838 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.32-snapshot.v20250326201838 --save-exact

@clerk/localizations

npm i @clerk/localizations@3.13.4-snapshot.v20250326201838 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.12.12-snapshot.v20250326201838 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.4.6-snapshot.v20250326201838 --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.25.5-snapshot.v20250326201838 --save-exact

@clerk/react-router

npm i @clerk/react-router@1.1.11-snapshot.v20250326201838 --save-exact

@clerk/remix

npm i @clerk/remix@4.5.11-snapshot.v20250326201838 --save-exact

@clerk/shared

npm i @clerk/shared@3.2.3-snapshot.v20250326201838 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@0.12.2-snapshot.v20250326201838 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.33-snapshot.v20250326201838 --save-exact

@clerk/themes

npm i @clerk/themes@2.2.26-snapshot.v20250326201838 --save-exact

@clerk/types

npm i @clerk/types@4.50.1-snapshot.v20250326201838 --save-exact

@clerk/vue

npm i @clerk/vue@1.4.5-snapshot.v20250326201838 --save-exact

@panteliselef
panteliselef merged commit 98286dc into main Mar 26, 2025
@panteliselef
panteliselef deleted the elef/sdki-955-persist-environment-locally branch March 26, 2025 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants